<integersAsConcatOfVariableSizeDigits>

[START QUOTE FROM integersAsConcatOfVariableSizeDigits.6.xml]
rangeThreeToFive = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ intThatMeansRange, 3, 5 }
	Object objectOperatorThenParams[]{ notUsed1, notUsed2, notUsed3 }
	Object iterRecurseChilds[0]
}

rangeThreeToFiveTheLessEfficientWay = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ -1, -1, -1 }
	Object objectOperatorThenParams[]{ operatorMeansRange, type3, type5 }
	Object iterRecurseChilds[0]
}

rangeThreeToFiveBetweenThoseEfficiencies = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ intThatMeansRange, -1, 5 }
	Object objectOperatorThenParams[]{ notUsed1, type3, notUsed2 }
	Object iterRecurseChilds[0]
}

type3 = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ intThatMeansRange, 3, 3 }
	Object objectOperatorThenParams[]{ notUsed1, notUsed2, notUsed3 }
	Object iterRecurseChilds[0]
}

There is no path from x^y to x*y, but there is a path from (x^y)*y to everywhere a path exists from x*y, therefore x^y and x*y can be used in the same iteration if iteration size includes (x^y)*y.

x = rangeTwoToThree
y = rangeOneToTen

xPowerY = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ intThatMeansPower, -1, -1 }
	Object objectOperatorThenParams[]{ notUsed1, x, y }
	Object iterRecurseChilds[0]
}

xMultiplyY = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ intThatMeansMultiply, -1, -1 }
	Object objectOperatorThenParams[]{ notUsed1, x, y }
	Object iterRecurseChilds[]{ x y }
}

xPowerYThenMultiplyY = Object[]{
	int myUniqueInt[1]
	int intOperatorThenParams[]{ intThatMeansMultiply, -1, -1 }
	Object objectOperatorThenParams[]{ notUsed1, xPowerY, y }
	Object iterRecurseChilds[]{ xPowerY, x, y }
}
[END QUOTE FROM integersAsConcatOfVariableSizeDigits.6.xml]


bayesNodeType = Object[]{
	int myUniqueInt[1]
	Object types[]{ uniqueIntArray, intArrayOfHeap, inverseIntArrayOfHeap, floArrayOfHeap, bayesNodeType, floArray,          floArray }
	Object sizes[]{ size1,          someRange,      someRange,             someRange,      range0To7,     twoTimesRange0To7, twoPowerRange0To7 }
}

Should a node type ave an extra array that tells the algorithm for each array?
Most arrays will be linear and always full, but others come in groups of 3 (int, int, flo) and use a heapQueue algorithm which is not linear.

So far the types only describe node types and array sizes and do not describe non-Object array types like int array and flo array.
Can the uniqueInt of each node (and therefore each type) be used to specify array type?

If the unique int of a type is less than 256 (or some constant) then it is a primitive array type or other standard type
like heapQueueForward (extends int array), heapQueueInverse (extends int array), or heapQueueValue (extends flo array).

This range in the global array, 0 to 255, includes array types and functions that can be used for array sizes (range, *, ^).

Should that range be negative so all positive indexs are normal?

Or add a size-1 int array to specify the type.
[0] = use other arrays to define node type.
[1] = int array.
[2] = flo array.
[]... heap types and more...

intArrayType = Object[]{
	int myUniqueInt[1]
	int myType[]{ intThatMeansIntArray }
	Object types[0]
	Object sizes[0]
}

bayesNodeType = Object[]{
	int myUniqueInt[1]
	int myType[]{ 0 }
	Object types[]{ uniqueIntArray, intArrayOfHeap, inverseIntArrayOfHeap, floArrayOfHeap, bayesNodeType, floArray,          floArray }
	Object sizes[]{ size1,          someRange,      someRange,             someRange,      range0To7,     twoTimesRange0To7, twoPowerRange0To7 }
}

Instead of a type being an int array, flo array, specific node type, etc,
the specific node types should be able to specify multiple primitive and nonprimitive types, like this:

bayesNodeType = Object[]{
	int myUniqueInt[1]
	int primitiveTypes[]{ 0,              15,             16,                    17,             -1,            2,                 2 }
	Object types[]{       uniqueIntArray, intArrayOfHeap, inverseIntArrayOfHeap, floArrayOfHeap, bayesNodeType, floArray,          floArray }
	//TODO update this type: if primitiveTypes[x] != -1 then types[x] must be used, else types[x] must not be used.
	Object sizes[]{       size1,          size3,      someRange,             someRange,      range0To7,     twoTimesRange0To7, twoPowerRange0To7 }
}

intArrayType is not needed.

Keep using xPowerYThenMultiplyY. That is good design.

All nodes should have unique int array at index 0 and Object array of type(s) at index 1.

typeOfSizeExpression = Object[]{
	int myInts[1]
	Object myTypes[1]
	int primitiveTypes[]{ -1,             -1,                    -1,                       -1 }
	Object types[]{       uniqueIntArray, intOperatorThenParams, objectOperatorThenParams, iterRecurseChilds }
	Object sizes[]{       size1,          size3,                 size3,                    sizeRange0To100 }
}

Add a function array to each node type. Those function(s) are used to execute each instance of the node type.

//TODO update this type: if primitiveTypes[x] != -1 then types[x] must be used, else types[x] must not be used.

bayesNodeType = Object[]{
	int myInts[1]
	Object myTypes[1]
	Obfunc funcs[b]{         a few bayesian function parts which can be called separately }
	Object funcIterSizes[b]{ twoPowerRange0To7ThenMultiplyRange0To7 }
	int arrayPrimitiveTypes[a]{ -1,             15,             16,                    17,             -1,            2,                 2 }
	Object arrayTypes[a]{       uniqueIntArray, intArrayOfHeap, inverseIntArrayOfHeap, floArrayOfHeap, bayesNodeType, floArray,          floArray }
	Object arraySizes[a]{       size1,          size3,          someRange,             someRange,      range0To7,     twoTimesRange0To7, twoPowerRange0To7 }
}


Should a size expression be this way?:

sizeExpr = Object[]{
	int myInts[1]
	Object myTypes[1] //Type can say which of those arrays are size 0
	Object iterRecurseChilds[?]
	//Of the 4 arrays [constInt, rangeExpr, multiplyExpr, powerExpr], 1 is used and the others are empty.
	int constInt[0 or 1]
	Object rangeExpr[0 or 2]
	Object plusExpr[0 or 2]
	Object multiplyExpr[0 or 2]
	Object powerExpr[0 or 2]
}

Should the int array at index 0 of every node always be at least size 2, where the second int
is 0 if its a normal node, 1 if its a normal type,
or some higher number if its a standard thing like *, ^, range, defineConstantInt, etc?

Should there be a second global array that contains negative numbers, and put the standard operators etc there, and set their int to that?
Example:
inverseIntArrayOfHeap = Object[]{
	int myInts[]{ -16 }
	Object myTypes[1]
	Object arrayTypes[0]
	Object arraySizes[0]
	Obfunc funcs[0]
	Object funcIterTrees[0]
}

Can intArrayOfHeap, inverseIntArrayOfHeap, and floArrayOfHeap be combined in an Obfunc that takes them all as params?
Where would that Obfunc and the parameters be stored? How can I avoid copying the arrays and linear iteration?
The best solution I've thought of so far is to use a few standard negative ints to mark the 3 types and always require they be at adjacent indexs in a node, an modify evolved code so it uses them together and never linearly

bayesNodeType = Object[]{
	int myInts[1]
	Object myTypes[1]
	Object arrayTypes[a]{       uniqueIntArray, intArrayOfHeap, inverseIntArrayOfHeap, floArrayOfHeap, bayesNodeType, floArray,          floArray }
	//TODO Can arraySizes be aligned to arrayTypes and not be sorted by their "int myInts[1]"?
	Object arraySizes[a]{       size1,          someRange,          someRange,         someRange,      range0To7,     twoTimesRange0To7, twoPowerRange0To7 }
	Obfunc funcs[b]{         a few bayesian function parts which can be called separately } //CHANGE THIS???
	Object funcIterTrees[b]{ twoPowerRange0To7ThenMultiplyRange0To7 } //REMOVE THIS???
	//TODO Specify which arrays to use as data and how many indexs in each to use simultaneously.
	//Example: If there are arrays size x, y, and x*y,
	//then should iterating over x*y use x+y indexs?
	//or should 1 index at a time be used in the x*y array?
	//or should x-size sections of the x*y array be used y times?
	//Solution: always use at most 1 index at a time from each array. Use more arrays if necessary.
}

How should the set of arrays for each Obfunc be specified?
Should there be exactly 1 root sizeExpr (or iterationExpr?) for each Obfunc in a node type?

Should Object iterRecurseChilds[?] in sizeExpr be changed?
Should it always include all possible childs including those that iterate partially redundantly?

sizeExpr = Object[]{
	int myInts[1]
	Object myTypes[1] //Type can say which of those arrays are size 0
	Object iterRecurseChilds[?] //Should this be removed, or should it be all possible recursions including partially redudant?
	//Of the 5 arrays [constInt, rangeExpr, plusExpr, multiplyExpr, powerExpr], 1 is used and the others are empty.
	int constInt[0 or 1]
	Object rangeExpr[0 or 2]
	Object plusExpr[0 or 2]
	Object multiplyExpr[0 or 2]
	Object powerExpr[0 or 2]
}

Should a new type be created for iteration order, separate from array size definitions?

iterInNode should probably include these things:
* Which nodeType it must be called on.
* Root iteration sizeExpr (often bigger than any array in the node).
* Which set of arrays (described by the node type) are read and/or written. From each of those, 1 index is used in every iteration.
* Path from root iteration sizeExpr to each array definition (in the node type) that is read and/or written.


iterInNode = Object[]{
	int myInts[1]
	Object myTypes[1]
	...
}

This is getting complex, and it takes too many nodes. It may be better to use strings of a simple syntax, where a0, a1, a2, etc are arrays in a node at specific indexs. Maybe a2 should be written as "node.2", meaning array 2 of the current node.
Should int literal 12 be written as "int.12"?
Example node array definitions:
String[]{
	"int.2", //this is node.0 //bayesFalse,bayesTrue
	"range(int.0 int.7)", //this is node.1 //bayes childs
	"*(node.0 node.1)", //this is node.2 //bayes weight sums
	"^(node.0 node.1)" //this is node.3 //bayes weights
}
Example iteration size: "*(node.3 node.1)"

Should range from 10 to 15 be written as "range.10.15"? "range" would appear to be a 2d array but would never expand.

How should a heapQueue in a node be written? Its probably less important than defining iteration and recursion, and should be done later.

How to define iteration?

This iteration example is too simple:
Iteration size: "*(node.3 node.1)"
Arrays to read/write: node.2 and node.3
//node.3 is "^(node.0 node.1)"
//node.1 is "range(int.0 int.7)"
//Iteration size partially expanded: "*(^(node.0 node.1) node.1)"

node.0 = ?
node.1 = ?
node.2 = *(node.0 node.1) //use this array
node.3 = ^(node.0 node.1) //use this array
iter   = *(node.3 node.1)

*(^(a b) b) --> a
Does it also work for *(*(a b) b) --> a?
In each iteration of ^(a b), any b --> specific a.
When not iterating, in *(a b), any b --> specific a, and any a --> specific b.
In each iteration of *(a b), a and b are known.
"*(^(a b) b) --> a" is unique to the power function, therefore making *(^(a b) b) be an operator (maybe called ^*) is probably better design than creating special cases for combinations of ^ and *.
But other combinations of ^ and * will be useful, just not as much optimizable, so it may be worse design to create an operator like ^*.

Operators:
*(a b)
	In each iteration *(a b), a and b are known.
^(a b)
	In each iteration ^(a b), nothing else is known.
^*(a b)
	In each iteration *(^(a b) b), ^(a b) and b and a are known.

This are some other random thoughts:
Start with any int var x.
Choose any var y, and replace x with *(^(x y) y), and it still equals x.

Operators:
^*(a b) <--> ^(a b) and b.
^*(a b) <--> *(^(a b) b). //does "and" equal "*"?
^(a b).
^(a b) and b --> a.
*(a b) <--> a and b.

Combine all "and" and "*". Operators:
a.
*(b c).
*(b c) --> b.
*(b c) --> c.
^(d e).
*(^(f g) g) --> f.
*(^(f g) g) --> ^(f g).
*(^(f g) g) --> g.

Simplify the way thats written:

^*(a b)
	^(a b)
	*(a b)
		a
		b

That has redundant iterations. Try again:

^*(a b)
	^(a b)
	b

Would it help to include the iteration variable i?

Try defining it with no redundant iterations, which requires the operators have different trees:

*(a b)
	a
	b

^*(c d)
	^(c d)
		c
	d

This is confusing.

New operator? ^**(c d) <--> *(^(c d) *(c d))

*(^(c d) *(c d))
	^(c d)
		c
	*(c d)
		c
		d

*(^(c d) d)
	^(c d)
		c
	d

*(c d)
	c
	d

^(c d)

c

Try again. This time, write multiple trees, and each tree allows duplicate iterations but in a unique way:

*(^(c d) d)
	^(c d)
	c
	d

*(c d)
	c
	d

^(c d)

c

^(^(c d) e)
	^(c *(d e))

The smallest interesting thing about ^ and * is:
*(^(c d) d) --> c

If d is 1, *(^(c d) d) can be the definition of any positive int c.

CHEMISTRY:
Is it coincidence that I've written the equation that best describes the (more correct in my opinion) periodic table shape?
If d is 2, *(^(c d) d) equals 2*c*c, and c=0, 0, 1, 1, 2, 2, 3, and 3 give the sizes of the first 8 periodic table rows, in the (more correct in my opinion) version where Helium(2) is above Beryllium(4) and the 2 columns on the left are rotated to the right (increasing the height of the periodic table by 1).
Is that a coincidence, or is the equation *(^(c d) d), maybe where d always equals 2, generally useful?


Try again to define all those operators and possible combinations of them in a simple consistent way:

b //constant int or range between 2 constant ints
c //constant int or range between 2 constant ints
d //constant int or range between 2 constant ints

*(b c) //Iteration size *(b c). Data is from *(b c).

^(b c) //Iteration size ^(b c). Data is from ^(b c).

//Try to explicitly define all combinations of * and ^, and allow recursive combining of those.

^overlap*(^(b c) *(c b)) //iteration size *(^(b c) c). Data is from ^(b c) and *(c b).

*overlap*(*(b c) *(c d)) //iteration size *(*(b c) d). Data is from *(b c) and *(c d).

//^palrevo^(^(b c) ^(c b)) //Does not align!!!

//^overlap*( ^(^(b c) c) *(c ^(b c)) ) //???

loop*(b c) //Iteration size *(b c). Data is only from c.


[QUOTE FROM ABOVE]
Example node array definitions:
String[]{
	"int.2", //this is node.0 //bayesFalse,bayesTrue
	"range(int.0 int.7)", //this is node.1 //bayes childs
	"*(node.0 node.1)", //this is node.2 //bayes weight sums
	"^(node.0 node.1)" //this is node.3 //bayes weights
}
Example iteration size: "*(node.3 node.1)"

Should range from 10 to 15 be written as "range.10.15"? "range" would appear to be a 2d array but would never expand.

How should a heapQueue in a node be written? Its probably less important than defining iteration and recursion, and should be done later.

How to define iteration?

This iteration example is too simple:
Iteration size: "*(node.3 node.1)"
Arrays to read/write: node.2 and node.3
//node.3 is "^(node.0 node.1)"
//node.1 is "range(int.0 int.7)"
//Iteration size partially expanded: "*(^(node.0 node.1) node.1)"

node.0 = ?
node.1 = ?
node.2 = *(node.0 node.1) //use this array
node.3 = ^(node.0 node.1) //use this array
iter   = *(node.3 node.1)
[END QUOTE FROM ABOVE]

iter   = ^overlap*(node.3 node.1)


//TODO allow recursion where iteration sizes and data sizes are different.
//Do I have to define data size recursively? The expressions above do not define data size.
//They only define quantity of data per iteration and where it comes from.


*overlap*(*(b c) *(c d)) //iteration size *(*(b c) d). Data is from *(b c) and *(c d).

//^palrevo^(^(b c) ^(c b)) //Does not align!!!

//^overlap*( ^(^(b c) c) *(c ^(b c)) ) //???

loop*(b c) //Iteration size *(b c). Data is only from c.


*(^(b c) *(c b))         //Iteration size *(^(b c) *(c b)). Data per iteration: 1*1 + 1*2.
loop*(^(b c) *(c b))     //Iteration size *(^(b c) *(c b)). Data per iteration: 0*1 + 1*2.
^overlap*(^(b c) *(c b)) //Iteration size *(^(b c) c).      Data per iteration  1*1 + 1*2.

loop(b)                  //Iteration size b. Data per iteration: 0.
loop*(^(b c) *(c b)) is the same as *(loop(^(b c)) *(c b))

^(b loop(c)) may not make sense, or maybe its similar to *(^(b c) loop(c))

Can ^overlap*(^(b c) *(c b)) be written any other way while using loop and/or loop*?

Probably loop(b) does not make sense when combined with ^ and when combined with * it can be written some other way that does not need it.


Operators:
b
*(b c)
^(b c)
^overlap*(^(b c) *(c b)) //Iteration size *(^(b c) c). Data is from ^(b c) and *(c b).
*overlap*(*(b c) *(c d)) //Iteration size *(*(b c) d). Data is from *(b c) and *(c d).
loop*(b c) //Iteration size *(b c). Data is only from c.
END Operators.


*overlap*(loop*(b c) *(c d)) //Iteration size *(*(b c) d). Data is from the first c and *(c d).
//Is there 2 data (first c and *(c d)) or 3 (first c, second c, d)?
This is a problem: *overlap*(*(b c) *(c d)) gets rid of the data from 1 of the 2 c's, but which one?
Recursion requires that be defined.
Thats easy. I could have 2 operators and do both, but the simplest is:
*overlap*(*(b c) *(c d)) has iteration size *(*(b c) d)
and the first c index overwrites the second c index during iterating.

I do not have to consider how *overlap*(*(b c) *(c d)) or ^overlap*(^(b c) *(c b)) can contain
anything other than * and ^ (exactly as written above) because it should not be allowed in that combination.
If you need to put a *overlap*(*(b c) *(c d)) in a *overlap*(*(b c) *(c d)),
then instead define a new operator that expects that type.

* and ^ both allow any combination of * and ^ and single array or range. They are flexible.

/** Immutable tree that defines an iteration order over
multiple arrays that have specific size constraints relative to eachother.
*/
public interface Iterint{

	/** quantity of iterations */
	public int iterlength();

	/** quantity of parameters in each iteration.
	Same as Flofunc.frsiz()
	*/
	public int iterwidth();

	/** iterwidth() <= i.length
	ERROR: This needs to run the child Iterint objects. Example: ^(b c) and *(z x).
	*/
	public void run(int i[]);

	/** Returns a new array of the childs of this Iterint.
	Similar to Flofunc.flofuncs().
	*/
	public Iterint[] iterints();

	/** childs.length must bes
	Similar to Flofunc.newInstance(Flofunc[]).
	*/
	public Iterint newInstance(Iterint childs[]);

}

/** an array of arbitrary size, and the same iteration size. */
public class IterintLinear implements Iterint{
	final int length;
	public IterintLinear(int length){ this.length = length; }
	public int iterlength(){ return length; }
	public int iterwidth(){ return 1; }
	public void run(int i[], and tell what object each time i[] gets new indexs?){

	}
}


public class IterintPower implements Iterint{
	Iterint base, exponent;
	public int iterlength(){ //TODO optimize
		int e = base.length();
		for(int i=1; i<exponent.length(); i++) e *= base.length();
		return e;
	}
	public int iterwidth(){ return 1; }
	public void run(int i[], and tell what object each time i[] gets new indexs?){
		???
	}
}


Simplify this and ignore efficiency for now. It will be compiled by Javassist in the end which is extremely fast.

public class IntMult implements Iterint{
	Iterint x, y;
	public int iterlength(){ //TODO optimize
		return x.iterlength() * y.iterLength();
	}
	public int iterwidth(){ return 2; }
	Need function that takes iteration number and gives x and y,
	and one that takes x and y and gives iteration number, //iterlength()?
	and one that takes iteration number and x and gives y.
	public void run(int i[], and tell what object each time i[] gets new indexs?){
		???
	}
}

Should each iterator object have only these 2 (or 3?) options?:
* Have exactly 2 child iterator objects.
* Be a range from constant int to constant int.
* Be a duplicate of some iterator's size. //Could be replaced by "Have exactly 2 child iterator objects" with the same 2 childs.


Should some iterators have more than 2 child iteraterators, to simplify the relationship between iterlength and iterwidth?
Example: replace ^overlap*(^(b c) *(c b)) with ^overlap*(i bPowerC cMultiplyB) or ^overlap*(i bPowerC c b)
Could replace i with bPowerC in those because its the same size as bPowerC.
Example: replace ^overlap*(^(b c) *(c b)) with ^overlap*(bPowerC cMultiplyB) or ^overlap*(bPowerC c b)
Because power functions can not be separated into 2 things during iteration, this does not simplify enough.

Should range be defined as +(min iterFromZeroToMaxMinusMin)?

Should each int constant be defined recursively as a base-2 number where all recursion ends at a size 0 or size 1?


Should each iterator object have x quantity of input ints and y quantity of output ints?
Example: ^overlap*(^(b c) *(c b)) would be ^overlap*(in_bPowerC in_c out_b)
combined with mult(in_x in_y out_xMultY), connecting in_c to in_x and out_b to in_y.
The combination has 2 inputs (in_bPowerC and in_c)
and any subset of [in_bPowerC in_c=in_x out_b=in_y out_xMultY] can be viewed as outputs.
The opposite of mult(in_x in_y out_xMultY) could be unmult(in_xMultY out_x out_y)
Connecting those 2 at 2 places each would input in_xMultY and output out_xMultY.
To always pair outputs with inputs 1 to 1, a copy(in_x out_x out_x) operator could be used.

Should these operators always have 3 parameters?

Should it always be [[2 in and 1 out] or [1 in and 2 out]]?

Example iteration (each letter is an int size):
Start: bPowerCThenMultC //control iteration linearly here
bPowerCThenMultC --> bPowerC, c //unmult
//Should copy bPowerC here so it remains at end for use with an array
(bPowerC is not affected) c --> c, c2 //copy
bPowerC, c (c2 is not affected) --> b //^overlap*
c2, b --> c2MultB //mult
//Use c2MultB and bPowerC_2 each with an array of the same size

Example iteration of single array size bPowerC:
Start: bPowerC //use directly with array. Its an input

Define array sizes in a node (which is an Object array) using these simple operators. Use a bigger array to contain the acyclic network (tree?) of operators, and the node is a smaller array which only has arrays of some of those sizes. The others are iterator definitions.

Example: a bayesian-node has arrays size x*y and x^y but no array size (x^y)*y. It does have an operator size (x^y)*y and probably more operators.

THE ITERATOR TREE (OR NETWORK?) ENDS AT SPECIAL OPERATORS, WHICH CONNECT TO THE ARRAYS, WHICH ARE DEFINED BY TREE OF OTHER OPERATORS.
To define a node's array sizes, first define the arbitrary sizes as some constant or range.
Then use operators with 2 inputs and 1 output to define array sizes that depend on those and other arrays in the same node.
Then use any operators to define iterators, averaging more outputs than inputs because an iterator must be 1 operator and can affect multiple arrays.
Between where the iterator trees (acyclic networks?) connect to the array size definitions, add a special operator (maybe called readWriteFlo) to say to use it as an array instead of recurse more.
These special operators specify the type of the thing in the node's array and what should be done with it.

These special operators include:
readFlo(out_index)
writeFlo(out_index)
readWriteFlo(out_index)
recurseNode(???what is iterwidth when recursing???)

There will be a special operator for recursing into a node thats parallel to a heapQueue (int[], int[], flo[]).
heapQueueRecurseNode(???what is iterwidth when recursing???)
That always uses the highest flo, which is paired with a specific low index
in the first int[] (probably 0, but I may hard-code 1) and can be at any index in the other 3 arrays.

Should these be the special operators instead of those above?: pushFlo, popFlo, pushNode, popNode?

There should be at least 2 iterator roots (used as parameterless functions) for this type of bayes node?:
* The first iterator bayesHeapQueueIter is: Get flo of node in heapQueue and recurse, calling bayesIter, then measure the bayesian node and update that flo.
* The next iterator bayesIter is: do the normal bayesian calculation. Should this be able to call bayesHeapQueueIter (on this node's heapQueue) depending on some condition?

How does that work if recurse heapQueues a different depth each time?
How does that work if recurse over the same node multiple times in the same recursion?

Should bayesHeapQueueIter(parentNode) call bayesIter(nodeInHeapQueue,flo) and replace that flo with the new value of nodeInHeapQueue in parentNode?

Should all execution start at an array of node, and put the first node to execute (the root node with a big heapQueue) at index 0, and add nodes as more heapQueues are traversed?

Using a flo from parentNode's heapQueue with bayesIter is complicated because bayesIter runs many times, and the flo should be updated only once.
That is similar to: how to run multiple iterators in sequence, and some conditionally on an if operator, all as 1 parent iterator object?

Should these iterator objects be able to RETURN something? Example: the flo in the parent node's heapQueue.

Should some arrays in a node be specified as read-only, and create or copy all other arrays as needed during recursion, to allow recursing through the same node multiple times?
Example: in a bayes node, the weights array (size 2^childs) is read-only, and the weight sum array (size 2*childs) is created new each time.

That could also be used to return a flo to the parent bayes node's heapQueue. Each recursion, a size-1 flo array should be created to read/write that flo.

Should arrays be pushed and popped, or should whole nodes (which share the read-only arrays) be pushed and popped during recursion?
Maybe, but lets get a simple network working first, with exactly 2 recursions (from net to node then to quickly see 1 number in childs of that node).

Create a neural network where the root heapQueue is updated when a size-1 flo array (always at the same index) in any node is updated.
That is updated when a node "fires" and each of its childs flo are updated in the root heapQueue.
This should be done without defining "root". Use recursion.

net = a node containing all other nodes in this neural network. They are all in a heapQueue sorted by their value.
nodea = a neural node in net.
nodeb = a neural node in net. Also a child of nodea.
(net, nodea, and nodeb are 3 of the same type of node but with different array sizes)

The purpose of this example neural network is to see how heapQueues can be used through deep recursion, not to create a useful neural network.

1 array in each of those nodes is a "virtual array" va thats parallel to the child node array ca. va is a view of the flo (in net's heapQueue) of each node in ca. Each node in ca is also in the heapQueue, but if it wasnt, the algorithm could be built to allow that.

Lots of types of virtual array could exist.
Example: a node array in the first node in this node's heapQueue
Example: a flo array in the first node in this node's heapQueue
Example: parent (in the current recursion) node's heapQueue
Example: Define recursion into child c by viewing all arrays in c as virtual arrays in this node. Any finite depth of recursion can be explicitly defined this way.

Should each node have an array (virtual array?) that contains the current stack during recursion?

<question importance=high>
	Nodes are constant size arrays which can be different types.
	Normal arrays are variable size and must have the same type.
	Should all arrays be defined as virtual, and only exist in memory as real arrays when needed for practical speed and size reasons?
	That would make Audivolv completely interpretable and also optimizable at runtime, which is a major improvement in consistency.
</question>

<question>
	How much caching, if any, should virtual arrays allow?
	For example, if it is a virtual flo array parallel to a node array, and the flos come from a heapQueue containing at least those nodes, then do reads and writes to the flo array always immediately affect the heapQueue?
</question>

<question>
	Should a heapQueue be viewable as a single virtual array of flo that can be iterated in 2 ways: normal random-access, or in decreasing order of flo value?
	The decreasing order of flo value would be size 1 unless the current flo decreases.
</question>

See selfBalancingSkipList files for a data structure that is probably as fast as heapQueue, works in the same quantity and size of arrays, and is totally sorted on average at all times.

















</integersAsConcatOfVariableSizeDigits>
